home *** CD-ROM | disk | FTP | other *** search
- // file : ribHorn4.pop
- // the ribHorn form has the same top level structure as a normal horn form,
- // but it's ribs are made up of reflected sub-horns.
- // this form modifies ribHorn3 by removing some of the movement variability
-
-
- /////////////////////////////////
- // population display settings //
- /////////////////////////////////
-
- population 0
- dimensions = 1
- colour_model RGB
- render_quality flat
-
-
- ////////////
- // genome //
- ////////////
-
- genome 0 {
-
- ////////////////
- // initialise //
- ////////////////
-
- // initialise scaling
- eggScale( 1 : 0.5 : 1 ), // allow smaller primitives than standard
- ratio( .2 : .1 : 1 ),
-
- // initialise material properties
- setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
- setTexture( norder false:toggle ),
- setBitmap( norder 0 : 0 : 20 ),
- *setWrap( norder 0 : 0 : 2 ),
-
- ///////////////
- // horn loop //
- ///////////////
-
- for( 2 : 2 : 40, 0, // mem[0] = #horn-segments
-
- // horn-segment code is made up of 2 distinct code blocks; the first block is executed
- // within a new scope, called the "segment rib"; the second block is executed within
- // the current scope and is called the "segment spine"
- join(
-
- // mem[1] = mem[0] % 2
- setScalarMem( 1, frac(div(getScalarMem(0),2)) ),
-
- /////////
- // rib //
- /////////
-
- scope(
- // rotate so that rib does not point in same direction as the spine
- rotate( <0,1.570796,0> : <-2,-2,-2> : <2,2,2> ),
- // move away from spine slightly
- //forward( 0 : -3 : 3 ),
- // re-shape primitive
- eggVectorScale( <1,1,1> : <1,1,1> : <10,10,10> ),
- // determine primitive type
- egg( 0 : 0 : 10 ),
- lay,
-
- // in this form the rib visually consists of a reflected sub-horn
- reflect( <1,1,-1> : <-1,-1,-1> : <1,1,1>,
- ///////////////////////////
- // rib visual : sub horn //
- ///////////////////////////
-
- ifElse( isMore( getScalarMem(1), 0 ),
-
- ////////////////////////
- // sub-alternative #1 //
- ////////////////////////
-
- join(
- // initialise material properties
- setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
- setTexture( norder false:toggle ),
- setBitmap( norder 0 : 0 : 20 ),
- *setWrap( norder 0 : 0 : 2 ),
-
- ///////////////
- // horn loop //
- ///////////////
-
- repeat( 1 : 1 : 40, // #sub-horn-segments
-
- // horn-segment code is made up of 2 distinct code blocks; the first block is executed
- // within a new scope, called the "segment rib"; the second block is executed within
- // the current scope and is called the "segment spine"
- join(
-
- /////////////
- // sub-rib //
- /////////////
-
- // in this horn the rib visually consists of a single primtive
- scope(
- // rotate so that rib does not point in same direction as the spine
- rotate( <0,1.570796,0> : <-2,-2,-2> : <2,2,2> ),
- // move away from spine slightly
- forward( 0 : -2 : 2 ),
- // re-shape primitive
- eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
- // determine primitive type and lay an egg
- egg( 0 : 0 : 10 ),
- lay
- ),
-
- ///////////////
- // sub-spine //
- ///////////////
-
- // updates the turtle state ready for the next segment
- forward( .5 : -1 : 1 ),
- scale( 1.05 : 1.01 : 1.1 ),
- rotate( <0,0,0> : <-.2,-.2,-.2> : <.2,.2,.2> ),
- moveHue( 0.03 : -0.08 : 0.08 ),
- moveSat( 0.01 : -0.08 : 0.08 ),
- moveVol( 0 : -0.2 : 0.2 ),
- scale( 1 : 0.9 : 1.1 ),
- moveRatio( 0 : -0.2 : 0.2 )
- )
- ) // end sub-horn repeat loop
- ), // end sub-horn-join block
-
- ////////////////////////
- // sub-alternative #2 //
- ////////////////////////
-
- join(
-
- // initialise material properties
- setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
- setTexture( norder false:toggle ),
- setBitmap( norder 0 : 0 : 20 ),
- *setWrap( norder 0 : 0 : 2 ),
-
- ///////////////
- // horn loop //
- ///////////////
-
- repeat( 1 : 1 : 40, // #sub-horn-segments
-
- // horn-segment code is made up of 2 distinct code blocks; the first block is executed
- // within a new scope, called the "segment rib"; the second block is executed within
- // the current scope and is called the "segment spine"
- join(
-
- /////////////
- // sub-rib //
- /////////////
-
- // in this horn the rib visually consists of a single primtive
- scope(
- // rotate so that rib does not point in same direction as the spine
- rotate( <0,1.570796,0> : <-2,-2,-2> : <2,2,2> ),
- // move away from spine slightly
- forward( 0 : -2 : 2 ),
- // re-shape primitive
- eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
- // determine primitive type and lay an egg
- egg( 0 : 0 : 10 ),
- lay
- ),
-
- ///////////////
- // sub-spine //
- ///////////////
-
- // updates the turtle state ready for the next segment
- forward( -.5 : -1 : 1 ),
- scale( 1.05 : 0.8 : 1.2 ),
- rotate( <0,0,0> : <-.2,-.2,-.2> : <.2,.2,.2> ),
- moveHue( -0.03 : -0.08 : 0.08 ),
- moveSat( 0.01 : -0.08 : 0.08 ),
- moveVol( 0 : -0.2 : 0.2 ),
- moveRatio( 0 : -0.2 : 0.2 )
- )
- ) // end sub-horn repeat loop
- ) // end sub-horn-join block
- ) // end ifElse
- ) // end reflect
- ), // end rib-scope
-
- ///////////
- // spine //
- ///////////
-
- // updates the turtle state ready for the next segment
- forward( 1 : -1 : 1 ),
- scale( 1.05 : 0.8 : 1.2 ),
- noseUp( 0 : -.2 : .2 ),
- moveHue( 0.01 : -0.08 : 0.08 ),
- moveSat( 0.03 : -0.08 : 0.08 ),
- moveVol( 0 : -0.2 : 0.2 ),
- moveRatio( 0 : -0.05 : 0.05 )
- )
- )
- }
-
-
- // eof : ribHorn4.pop
-
-